package com.me.modules.problem.service.impl;

import com.me.modules.common.common.Constant;
import com.me.modules.common.page.Page;
import com.me.modules.common.page.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.me.modules.problem.dao.ProblemInfoDao;
import com.me.modules.problem.entity.ProblemInfoEntity;
import com.me.modules.problem.service.ProblemInfoService;



@Service("problemInfoService")
public class ProblemInfoServiceImpl implements ProblemInfoService {
	@Autowired
	private ProblemInfoDao problemInfoDao;

	@Override
	public ProblemInfoEntity queryObject(String id){
		return problemInfoDao.queryObject(id);
	}

	@Override
	public List<ProblemInfoEntity> queryList(Map<String, Object> map){
		return problemInfoDao.queryList(map);
	}

    @Override
    public List<ProblemInfoEntity> queryListByBean(ProblemInfoEntity entity) {
        return problemInfoDao.queryListByBean(entity);
    }

	@Override
	public int queryTotal(Map<String, Object> map){
		return problemInfoDao.queryTotal(map);
	}

	@Override
	public int save(ProblemInfoEntity problemInfo){
		return problemInfoDao.save(problemInfo);
	}

	@Override
	public int update(ProblemInfoEntity problemInfo){
        return problemInfoDao.update(problemInfo);
	}

	@Override
	public int delete(String id){
        return problemInfoDao.delete(id);
	}

	@Override
	public int deleteBatch(String[] ids){
        return problemInfoDao.deleteBatch(ids);
	}

	@Override
	public Page<ProblemInfoEntity> findPage(ProblemInfoEntity problemInfo, int pageNum) {
		PageHelper.startPage(pageNum, Constant.pageSize);
		problemInfoDao.queryList(problemInfo);
		return PageHelper.endPage();
	}
}
